Skip to content

Conversation

MaxwellGengYF
Copy link

_lzcnt_u64 may not supported by native LLVM compiler on Windows.

_lzcnt_u64 may not supported by native LLVM compiler on Windows.
@solbjorn
Copy link

I don't have any issues with compiling mimalloc3 with LLVM under Visual Studio (for more than half a year), could you elaborate?

@MaxwellGengYF
Copy link
Author

I don't have any issues with compiling mimalloc3 with LLVM under Visual Studio (for more than half a year), could you elaborate?

When you are using Visual-Studio, you are actually using clang-cl.exe instead of clang.exe, which the driver mode is like cl.exe instead of 'original' clang

@solbjorn
Copy link

solbjorn commented Sep 7, 2025

I don't have any issues with compiling mimalloc3 with LLVM under Visual Studio (for more than half a year), could you elaborate?

When you are using Visual-Studio, you are actually using clang-cl.exe instead of clang.exe, which the driver mode is like cl.exe instead of 'original' clang

But you added the condition under the _MSC_VER definition, which assumes either clang-cl OR clang -fms-compatibility. Both of them should provide the function you're trying to toss off.

__clang__ is defined under both clang and clang-cl, so your check should be more precise either way. For example, set via a CMake feature test whether the function is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants